#ifndef __MISSILE_H__
#define __MISSILE_H__

#include <windows.h>
#include <gl/GL.h>
#include <gl/glu.h>
#include <gl/glut.h>

#include "Subject.h"

class Missile : public Subject
{
private:
	float x, y, z;
	float radius;
	float height;
	float rotate_angle;
	float lift_angle;
	GLUquadric* quadric;
public:
	Missile(float x, float y, float z, float radius, float height, float rotate_angle, float lift_angle)
	{
		this->x = x;
		this->y = y;
		this->z = z;
		this->height = height;
		this->radius = radius;
		this->rotate_angle = rotate_angle;
		this->lift_angle = lift_angle;
	}
	~Missile()
	{
		gluDeleteQuadric(quadric);
	}
	void NotifyObserver()
	{
	}
	void AddObserver(Observer* pOb)
	{
	}
	void Draw()
	{
		//glRotatef(-90.0, 1, 0, 0);
		glColor3f(0, 1.0, 0);
		glTranslatef(x, y, z-height);
		glRotatef(rotate_angle, 0, -1, 0);
		glRotatef(lift_angle, 1, 0, 0);
		glBegin(GL_POLYGON);
		quadric = gluNewQuadric();
		gluCylinder(quadric, radius, radius, height, 10, 16);
		glEnd();
	}
};
#endif